﻿/*
 *  Source code courtesy of the desktopWeb.CodePlex.com community project. See MS-PL license on Codeplex.com. 
 *  This is beta code not intended for a production application.
 */


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.ComponentModel;
using System.Collections.ObjectModel;
using Microsoft.SharePoint.Client;
using System.Windows.Data;
using System.Globalization;

namespace MyData.Activities
{
  //Current version uses SharePoint operator names. The next version will use more friendly enum names.
  //  EqualTo, LessThan, LessThanOrEqualTo, GreaterThan, GreaterThanOrEqualTo, NotEqualTo
  public enum ComparisonOperatorEnum
  {
    Eq, Neq, Gt, Geq, Lt, Leq, IsNull, BeginsWith, Contains
  }

  //Eq = Equals
  //Neq = Not equal
  //Gt = Greater than
  //Geq = Greater than or equal
  //Lt = Lower than
  //Leq = Less than or equal too
  //IsNull = Is null
  //BeginsWith = Begins with
  //Contains = Contains

  //NEXT: Currently not supported
  public enum LogicalOperatorEnum
  {
    None, And, Or
  }

  public enum SharePointTypeEnum
  {
    Text, Number, DateTime 
  }

  [Designer(typeof(MyData.Activities.Designers.QueryDesigner))]
  public sealed class CamlWhere : Activity
  {
    public InArgument<string> FieldRef { get; set; }
    public ComparisonOperatorEnum ComparisonOperator { get; set; }
    public InArgument<object> Value { get; set; }
    public SharePointTypeEnum ValueType { get; set; }

    //Currently not supported
    LogicalOperatorEnum LogicalOperator { get; set; }

   
  }
}

